from django.db import models

#导入时间域
from django.utils import timezone

#基类
class Base(models.Model):

	#创建时间
	create_time = models.DateTimeField(default=timezone.now,null=True)

	class Meta:
		abstract = True

#用户类
class User(Base):

	id = models.AutoField(primary_key=True)
	username = models.CharField(max_length=100)
	password = models.CharField(max_length=200)
	num = models.IntegerField()
	phone = models.CharField(max_length=100)

	class Meta:
		db_table = "user"

#课程类
class Course(Base):

	id = models.AutoField(primary_key=True)
	title = models.CharField(max_length=100)
	desc = models.CharField(max_length=200)
	price = models.IntegerField()
	cid = models.IntegerField()
	video = models.CharField(max_length=200)

	class Meta:
		db_table = "course"


#课程关注
class Flow(Base):

	id = models.AutoField(primary_key=True)
	uid = models.IntegerField()
	course_id = models.IntegerField()

	class Meta:
		db_table = "flow"












